srcdir=./
objdir=obj/
bindir=bin/
includedir=../../src/
includeLibs=../../externLibs
CXX=g++
CXXFLAGS=-Wall -s -O2
LDFLAGS=-L../../lib -lEpix3D
EXE=demo
SRC= $(wildcard $(srcdir)*.cpp)
OBJ= $(SRC:%.cpp=$(objdir)%.o)

all: depend $(EXE)

$(EXE): $(OBJ)
	$(CXX) -o $(bindir)$@ $^ $(LDFLAGS) $(CXXFLAGS)

depend: 
	$(CXX) -MM $(SRC) >depend

-include depend

$(objdir)%.o: %.cpp
	$(CXX) -o $@ -c $< $(CXXFLAGS) -I$(includedir) -I$(includeLibs)

.PHONY: clean mrproper

clean:
	rm -rf $(objdir)*.o

mrproper: clean
	rm -rf $(bindir)$(EXE)
	rm -rf *~
